From: Florian Müllner Date: Tue, 11 Sep 2018 13:36:35 +0000 (+0200) Subject: inputMethod: Fix setting surrounding text X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2^2~10 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a35382d6fcbd2e81461c529c2fe0ec111fced8da;p=gnome-shell.git inputMethod: Fix setting surrounding text The underlying ibus method expects an object of type IBusText rather than a plain string. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/228 --- diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js index ec84f7277..7fb78178a 100644 --- a/js/misc/inputMethod.js +++ b/js/misc/inputMethod.js @@ -176,8 +176,11 @@ var InputMethod = new Lang.Class({ }, vfunc_set_surrounding(text, cursor, anchor) { - if (this._context && text) - this._context.set_surrounding_text(text, cursor, anchor); + if (!this._context || !text) + return; + + let ibusText = IBus.Text.new_from_string(text); + this._context.set_surrounding_text(ibusText, cursor, anchor); }, vfunc_update_content_hints(hints) {